package cn.com.self.apis.portal.entity;

import cn.com.selfsoft.smartcity.commons.entity.AbstractEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.sql.Timestamp;

/**
 * 交易记录
 * @author CRL
 * @date 2021/1/9 21:28
 */
@TableName("u_transaction_records")
@Data
public class TransactionRecordEntity extends AbstractEntity {

    @ApiModelProperty(value = "交易类型（1充值、2提现、3退款、4托管类型、5订单等）")
    private BigInteger transactionType;

    @NotNull(message = "交易信息对象id不能为空")
    @NotBlank(message = "交易信息对象id不能为空")
    @ApiModelProperty(value = "交易信息对象id")
    private BigInteger objId;

    @NotNull
    @ApiModelProperty(value = "总金额")
    private BigInteger totalAmount;

    @NotNull
    @ApiModelProperty(value = "实际金额")
    private BigInteger realAmount;

    @ApiModelProperty(value = "交易状态（1已完成、2未完成）")
    private String transactionState;

    @ApiModelProperty(value = "交易时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp time;

    @ApiModelProperty(value = "交易编号（支付宝、微信）")
    private String no;

}
